<template>
  <a-locale-provider :locale="locale">
    <div id="app">
      <router-view/>
    </div>
  </a-locale-provider>
</template>

<script>
import Vue from 'vue'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { AppDeviceEnquire } from '@/utils/mixin'
import { mapActions } from 'vuex'

export default {
  mixins: [AppDeviceEnquire],
  data () {
    return {
      locale: zhCN
    }
  },
  methods: {
    ...mapActions([
      'SET_INFO'
    ]),
    init () {
      const user = Vue.ls.get('userInfo')
      if (user) {
        this.$store.commit('SET_INFO', user)
      }
    }
  },
  mounted () {
    //
  },
  created () {
    this.init()
  }
}
</script>
<style>
  #app {
    height: 100%;
  }
</style>
